package thread;

public class Demo34 {
    private static int ret = 0;
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable(){
            public void run() {
                int sum = 0;
                for(int i = 0; i < 10; i++) {
                    sum += i;
                }
                ret = sum;
            }
        });
        t1.start();
        t1.join();
        System.out.println("ret = " + ret);
    }
}
